<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">


<title>whit-大数据博客 | 注册 </title>


<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
<!-- Bootstrap 3.3.6 -->
<!-- Font Awesome -->
<!-- Ionicons -->
<!-- Theme style -->
<!-- iCheck -->
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->

<link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/ionicons/css/ionicons.min.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/adminLTE/css/AdminLTE.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/iCheck/square/blue.css">

<link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/bootstrapValidator/bootstrapValidator.css">
</head>

<body class="hold-transition register-page">
	<div class="register-box">
		<div class="register-logo">
			 <a href="#"><b>whit</b>大数据博客</a>
		</div>

		<div class="register-box-body">
			<p class="login-box-msg">新用户注册</p>
			<p>${message }</p>
			<form id="form1" action="${pageContext.request.contextPath}/UserServlet?method=reguser" method="post">
				<div class="form-group has-feedback">
					<input id="userName" name="userName" type="text" value="${userName }"
						class="form-control" placeholder="登录名"> <span
						class="glyphicon glyphicon-user form-control-feedback"></span>
				</div>
				<div class="form-group has-feedback">
					<input type="email" name="email" id="email" class="form-control" value="${email }"
						placeholder="电子邮箱地址"> <span
						class="glyphicon glyphicon-envelope form-control-feedback"></span>
				</div>
				<div class="form-group has-feedback">
					<input type="password" id="password" name="password"
						class="form-control" placeholder="密码"> <span
						class="glyphicon glyphicon-lock form-control-feedback"></span>
				</div>
				<div class="form-group has-feedback">
					<input type="password" id="repassword" name="repassword"
						class="form-control" placeholder="确认密码"> <span
						class="glyphicon glyphicon-log-in form-control-feedback"></span>
				</div>
				<div class="row">
					<div class="col-xs-8">
						<div class="checkbox icheck">
							<label> <input type="checkbox"> 我同意 <a href="#">协议</a>
							</label>
						</div>
					</div>
					<!-- /.col -->
					<div class="col-xs-4">
						<button type="submit" onclick="submitForm();" class="btn btn-primary btn-block btn-flat">注册</button>
					</div>
					<!-- /.col -->
				</div>
			</form>

			<div class="social-auth-links text-center">
				<p>- 或者 -</p>
				<a href="#" class="btn btn-block btn-social btn-facebook btn-flat"><i
					class="fa fa-qq"></i> 腾讯QQ用户登录</a> <a href="#"
					class="btn btn-block btn-social btn-google btn-flat"><i
					class="fa fa-weixin"></i> 微信用户登录</a>
			</div>

			<a href="${pageContext.request.contextPath}/view/user/login.jsp" class="text-center">我有账号，现在就去登录</a>
		</div>
		<!-- /.form-box -->
	</div>
	<!-- /.register-box -->

	<!-- jQuery 2.2.3 -->
	<!-- Bootstrap 3.3.6 -->
	<!-- iCheck -->
	<script
		src="${pageContext.request.contextPath}/plugins/jQuery/jquery-2.2.3.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/bootstrap/js/bootstrap.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/iCheck/icheck.min.js"></script>

	<script
		src="${pageContext.request.contextPath}/plugins/bootstrapValidator/bootstrapValidator.js"></script>
	<script>
		function submitForm(){
			if(true){
				;
			}
		}
		
		$(function() {
			//将checkbox渲染为icheck样式
			$('input').iCheck({
				checkboxClass : 'icheckbox_square-red',
				radioClass : 'iradio_square-red',
				increaseArea : '20%' // optional
			});

			//此处为校验的核心代码
			$("#form1").bootstrapValidator({
				submitHandler : function(valiadtor, loginForm, submitButton) {

					valiadtor.defaultSubmit();
				},
				fields : {
					userName : {
						validators : {
							notEmpty : {
								message : '用户名不能为空'
							},
							stringLength : {
								/*长度提示*/
								min : 4,
								max : 30,
								message : '用户名长度必须在4到30之间'
							}
						}
					},
					email : {
						validators : {
							notEmpty : {
								message : '邮箱地址不能为空'
							},
							emailAddress : {
								message : '请输入正确的邮箱地址'
							}
						}
					},
					password : {
						validators : {
							notEmpty : {
								message : '密码不能为空'
							},
							stringLength : {
								min : 4,
								max : 30,
								message : '密码长度必须在4到30之间'
							},
							different : {//不能和用户名相同
								field : 'userName',//需要进行比较的input name值
								message : '不能和用户名相同'
							},
							regexp : {
								regexp : /^[a-zA-Z0-9_\.]+$/,
								message : '密码由数字字母下划线和.组成'
							},
							identical : {//相同
								field : 'repassword',
								message : '两次密码不一致'
							}
						}
					},
					repassword : {
						validators : {
							notEmpty : {
								message : '密码不能为空'
							},
							stringLength : {
								min : 4,
								max : 30,
								message : '密码长度必须在4到30之间'
							},
							different : {//不能和用户名相同
								field : 'userName',//需要进行比较的input name值
								message : '不能和用户名相同'
							},
							regexp : {
								regexp : /^[a-zA-Z0-9_\.]+$/,
								message : '密码由数字字母下划线和.组成'
							},
							identical : {//相同
								field : 'password',
								message : '两次密码不一致'
							}
						}
					}
				}
			});

		});

		$(function() {
			$('input').iCheck({
				checkboxClass : 'icheckbox_square-blue',
				radioClass : 'iradio_square-blue',
				increaseArea : '20%' // optional
			});
		});
	</script>
</body>

</html>